#ifndef Framework_h__
#define Framework_h__

#include "core/Singleton.h"
#include "display/state/State.h"
#include "display/Mask.h"
#include "display/state/StateManager.h"
#include "display/dialog/DialogManager.h"

class State;
class Framework : public Singleton<Framework>
{
public:
	CCScene* mainScene;
	float screenWidth;
	float screenHeight;
	CCLayer* stateLayer;
	CCLayer* globalLayer;
	CCLayer* modelDialogLayer;
	CCLayer* modelLessDialogLayer;
	CCLayer* topLayer;
	CCNode* maskLayer;
	void init();
private:
	CCDirector *pDirector;
	State* curState;
	StateManager* stateManager;
	DialogManager* dialogManager;
	std::string mLastState;
	std::string mCurState;
public:
	Framework(void);
	~Framework(void);
	float getScreenWidth();
	float getScreenHeight();
	void changeState(const char* name);
	void changeState(State* state);
	void lastState();
	void setStateManager(StateManager* stateManager);
	void setDialogManager(DialogManager* dialogManager);
	void popup(const char* name, void* data=NULL, float offsetX=0, float offsetY=0);
};

#endif